<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>轮播图列表</title>
<jsp:include page="../common/top.jsp"></jsp:include>
</head>
<body class="page-content">
	<div class="page-content-area" data-ajax-content="true">
		<div class="page-header">
			<h1>轮播图列表</h1>
		</div>
		<div class="row">
			<div class="col-xs-12">
				<div class="row">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-header widget-header-small">
								<h5 class="widget-title lighter">搜索栏</h5>
							</div>
							<div class="widget-body">
								<div class="widget-main">
									<form id="_form" class="form-inline"></form>
								</div>
							</div>

						</div>
						<div>
							<div class="dataTables_wrapper form-inline no-footer">
								<table id="_table"
									class="table table-striped table-bordered table-hover dataTable no-footer"></table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>



	<jsp:include page="../common/bottom.jsp"></jsp:include>
	<script type="text/javascript">
		var $table;
		jQuery(function($) {
			// 列表
			$table = $("#_table")
					.table(
							{
								url : "${path}/admin/slideShow/list",
								formId : "_form",
								tools : [

										{
											text : '删除',
											clazz : 'btn-danger',
											icon : 'fa fa-trash-o red',
											handler : function() {
												$table
														.ajaxDelete({
															confirm : "该操作会删除选中的信息，确定继续操作?",
															url : "${path}/admin/slideShow/delete"
														});
											}
										},
										{
											text : '添加轮播图',
											clazz : 'btn-info',
											icon : 'fa fa-plus-circle blue',
											handler : function() {
												window.location.href = "${path}/admin/slideShow/edit";
											}
										}

								],
								columns : [
										{
											field : 'id',
											hide : true
										},

										{
											field : 'imageUrl',
											title : '图片',
											align : 'left',
											replace : function(row) {
												var img = row.imageUrl;
												var html = '<img src="'+ img +'" width="120px">'
												return html;
											}
										} ],
								operate : [ {
									text : '修改轮播图信息',
									clazz : 'blue',
									icon : 'fa fa-pencil',
									permission : '/admin/slideShow/edit',
									handler : function(d, i) {
										window.location.href = "${path}/admin/slideShow/edit?id="
												+ d.id;
									}
								},{
									text : '删除',
									clazz : 'red',
									icon : 'fa fa-trash-o',
									permission : '/admin/slideShow/delete',
									handler : function(d, i) {
										$table
												.ajaxDelete({
													confirm : "该操作会删除该文章所有信息，确定继续操作?",
													url : "${path}/admin/slideShow/delete"
												});
									}
								} ],
								after : function() {
									// 权限处理
									$.permission();
								}
							});

			//搜索
			$(".search-data").keyup(function() {
				$table.search();
			});

		});
	</script>
</body>
</html>

